<h2>Why is this an issue?</h2>
<p>Deprecated methods are functions or properties that are no longer recommended and are likely to be removed in future updates of the library. They
are often replaced with newer methods that offer better performance, security, or usability.</p>
<p>Using deprecated methods in React can lead to the following issues:</p>
<ul>
  <li> <strong>Code Maintainability</strong>: As deprecated methods are removed in future versions, the code will break if not updated. This can lead
  to increased time and effort in code maintenance. </li>
  <li> <strong>Performance</strong>: Newer methods often come with performance improvements. Using deprecated methods can lead to slower app
  performance. </li>
  <li> <strong>Security</strong>: Deprecated methods may have known security issues that are fixed in newer methods. </li>
</ul>
<pre data-diff-id="1" data-diff-type="noncompliant">
import React, { useState, useEffect } from 'react';

function MyComponent(props) {
  const [state, setState] = useState(initialState);

  componentWillReceiveProps(nextProps) { // Noncompliant: deprecated lifecycle method
    // Some code here...
  }

  componentWillUpdate(nextProps, nextState) { // Noncompliant: deprecated lifecycle method
    // Some code here...
  }

  render() {
    return &lt;div&gt;Hello World&lt;/div&gt;;
  }
}
</pre>
<p>To fix this issue, check React’s upgrading guide, replace the deprecated methods with their newer counterparts, and adapt your component’s
implementation accordingly.</p>
<pre data-diff-id="1" data-diff-type="compliant">
import React, { useState, useEffect } from 'react';

function MyComponent(props) {
  const [state, setState] = useState(initialState);

  // Using useEffect to replace deprecated lifecycle methods
  useEffect(() =&gt; {
    // Code to run on component update
  }, [props]); // This will run when `props` changes

  return &lt;div&gt;Hello World&lt;/div&gt;;
}
</pre>
<h2>Resources</h2>
<h3>Documentation</h3>
<ul>
  <li> <a href="https://github.com/jsx-eslint/eslint-plugin-react">eslint-plugin-react</a> - Rule <a
  href="https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/no-deprecated.md">no-deprecated</a> </li>
  <li> React Documentation - <a href="https://react.dev/reference/react">React Reference Overview</a> </li>
</ul>
